babl.db: if git hash has changed, drop cache
authorØyvind Kolås <pippin@gimp.org>
Mon, 14 Nov 2016 19:47:39 +0000 (20:47 +0100)
committerØyvind Kolås <pippin@gimp.org>
Mon, 14 Nov 2016 19:47:39 +0000 (20:47 +0100)
babl/babl.c

index 319977794edd8b29f31e7a83a784c345b0786501..22c104cf6d4c0f06705e56aeb2bb37cc20ffe93d 100644 (file)
@@ -296,6 +296,12 @@ static void babl_init_db (const char *path)
           babl=NULL;
           break;
         case '#':
+          /* if babl has changed in git .. drop whole cache */
+          if (strcmp ( &token[1], BABL_GIT_VERSION))
+          {
+            free (contents);
+            return;
+          }
           break;
         case '\t':
           if (strchr (token, '='))